echo "Warning, Please format and mount at /mnt/f2fs"
sleep 3

echo "Set PATH"
export PATH=/home/gary/Installer/mongodb-linux-x86_64-ubuntu1604-4.2.8/bin:$PATH

echo "Kill current mongo"
sudo pkill mongod

echo "Create MongoDB work dir on /mnt/f2fs"
sudo mkdir -p /mnt/f2fs/mongo
sudo mkdir -p /mnt/f2fs/mongodb
sudo chown `whoami` /mnt/f2fs/mongo
sudo chown `whoami` /mnt/f2fs/mongodb

echo "Start MongoDB"
mongod --dbpath /mnt/f2fs/mongo --logpath /mnt/f2fs/mongodb/mongod.log --fork

echo "Start finish, check log:"
tail -10f /mnt/f2fs/mongodb/mongod.log
